If _ name _ = '_ main _' How to correctly understand, __name ___ main __Preface:
In the eyes of friends, you are James (_ name _ = 'James '),You are yourself (_ name _ = '_ main __'),Your programming is very good. A friend calls you to help him
Function of _ name _ = '_ main _' in python, __name ___ main __
Python ScriptIt is a widely used batch automatic processing solution, and any. py extension file can be used as a Module file in the Python execution program. From the design philosophy
In python, if _ name _ = '_ main _':, __name ___ main __
When you open. in The py file, if _ name _ = '_ main _' is often displayed at the bottom of the Code. Now let's introduce its role.
A module is an object, and all modules have a built-in
Explores the "standard" Writing Method of the main function, obtains the parameters and return values of the main function, and explores the main functionMain function notation
When I was a beginner in C or C ++, many people have seen a variety of
Analysis of if _ name _ = '_ main _' in Python
This article mainly introduces the function of if _ name _ = '_ main _' in Python, which is very common in Python and plays a role? This article explains its role. For more information, see
When you
This article is an example of JS get URL parameters, the main domain name method. Share to everyone for your reference, specific as follows:
More readers interested in JavaScript-related content can view the site topics: "JavaScript Search
I explained the second-level domain name on the IP address. when the second-level domain name does not allow him to access the address book of the main site, the second-level domain name is edited by liaohongchu from 2012-11-2116:42:50;
I explained the second-level domain name on the IP address. when the second-level domain name does not allow him to access the address book of the main site, the second-level domain name is edited by liaohongchu from 2012-11-2116:42:50;
When you open a. py fileCodeAt the bottom of the page, we can see if _ name _ = '_ main _':. Now let's introduce its role.
A module is an object, and all modules have a built-in attribute _ name __. The value of _ name _ of a module depends on how
_ Name __:
When using itself, it is main, for example, you execute:Python test. pyThe name in test. py is main.If you import test in test2, then name is the file name http://www.cnblogs.com/herbert/archive/2011/09/27/2193482.html
I have seen many
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.